package com.xbongbong.saas.domain.entity;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author Jian.Wang
 * @date  2019-01-25 10:58
 **/
@Getter
@Setter
@ToString
public class PurchaseProductEntity extends BusinessUnitProductEntity implements Serializable {

    private static final long serialVersionUID = -7985802668512576950L;
    /**
     * 主键
     */
    private Long id;
    /**
     * 公司id
     */
    private String corpid;
    /**
     * 采购合同id
     */
    private Long purchaseSheetId;
    /**
     * 父产品id
     */
    private Long parentId;
    /**
     * 产品id
     */
    private Long productId;
    /**
     * 产品名称
     */
    private String productName;
    /**
     * 产品编号
     */
    private String productNo;
    /**
     * 产品规格
     */
    private String productSpecification;
    /**
     * 产品数量
     */
    private Double productNum;
    /**
     * 产品单位
     */
    private String productUnit;
    /**
     * 产品实际采购价格，也叫做折扣价
     */
    private Double productPrice;
    /**
     * 折扣
     */
    private Double discount;
    /**
     * 优惠
     */
    private Double otherCharge;
    /**
     * 采购金额,为最终的折扣价
     */
    private Double money;
    /**
     * 产品备注
     */
    private String memo;
    /**
     * 添加时间
     */
    private Long addTime;
    /**
     * 更新时间
     */
    private Long updateTime;
    /**
     * 删除标志
     */
    private Integer del;
    /**
     * 导出时的产品规格
     */
    private String formatedSpecifiation;
    /**
     * 产品封面图片地址
     */
    private String imageUrl;
    /**
     * 产品展示排序
     *
     */
    private Integer sort;
    /**
     * 产品分类
     */
    private Integer categoryId;
    /**
     * 产品条码
     */
    private String barcode;

    private String priceStr = "";
    private String productNumStr = "";
    private JSONArray specificationArray = new JSONArray();
    private Integer ifChoose;
    private String thumbnail;

    private JSONArray linkSupplierId;

    private JSONObject data;

    private Double instockNum;

    private Double outstockNum;

    private Double waitInstockNum;

    /**
     * 上游关联产品数据id
     */
    private Long refProductId;

    // 关联合同ID
    private Long contractId;
    // 合同产品ID
    private Long contractProductId;

    public PurchaseProductEntity() {
        this.discount =100D;
        this.instockNum = 0D;
        this.outstockNum = 0D;
        this.productNum = 0D;
    }
}
